<?php
// Show Table
$crud->showTable();

//down below the showTable() function
function doMyLogicForAdding($array)
{
    //these indexes are the fields of the db
    $pkMenuID = $array[id];
    $fldName1 = $array[username];
    $fldName2 = $array[password];
    
    $success = qr("UPDATE cms_admins SET username = '".ucfirst(strtolower($fldName1))."', password = '".md5($fldName2)."' WHERE id = '".$pkMenuID."'");
}


////////////////////////////////////
function formatAsTitle($i)
{
    $q = mysql_query("SELECT title FROM ".tPages." WHERE id = '".$i."'")or die(mysql_error());
    $d = mysql_fetch_object($q);
    return $d->title;
}

function formatAsAdmin($i)
{
    $q = mysql_query("SELECT username FROM ".tAdmins." WHERE id = '".$i."'")or die(mysql_error());
    $d = mysql_fetch_object($q);
    return $d->username;
}

function formatAsPw($data)
{
    return 'hidden';
}
